#include <stdio.h>

int main()
{
    int n;
    scanf("%d", &n);
    int bai = n / 100;
    int ge = n % 10;
    int shi = n / 10 - 10 * bai;
    printf("%d",ge * 100 + shi * 10 + bai);
    return 0;
}